<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * sys_user表创建
 */
class Migration_sys_role extends CI_Migration
{
	public function up()
	{
		$this->dbforge->add_field([
			'vid' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true,
				'auto_increment' => TRUE, 'comment' => '虚id'],
			'id' => ['type' => 'CHAR', 'constraint' => 36, 'unique' => TRUE],
			'role_value' => ['type' => 'VARCHAR', 'constraint' => 50,
				'comment' => '角色值'],
			'role_name' => ['type' => 'VARCHAR', 'constraint' => 50,
				'comment' => '角色名称'],
		]);
		$this->dbforge->add_key('vid', TRUE);
		$this->dbforge->create_table('sys_role', false, ['comment' => "'系统角色表'"]);
	}

	public function down()
	{
		$this->dbforge->drop_table('sys_role');
	}
}
